/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package 解析.node.node;

import 解析.Matcher;

/**
 *
 * @author yanxi
 */
public class LastNode extends Node {

    //This method implements the classic accept node with the addition of a check to see if the match occurred using all of the input.  
    @Override
    public boolean match(Matcher matcher, int i, CharSequence seq) {
        if (matcher.acceptMode == Matcher.ENDANCHOR && i != matcher.to) {
            return false;
        }
        matcher.last = i;
        matcher.groups[0] = matcher.first;
        matcher.groups[1] = matcher.last;
        return true;
    }
    
    @Override
    public String toString(){
        return "<<结束>>";
    }
    
}
